package com.HeadlineSystem.web;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.HeadlineSystem.service.CategoryService;
import com.HeadlineSystem.service.impl.CategoryServiceImpl;

public class CategoryServlet extends HttpServlet {
private CategoryService cs=new CategoryServiceImpl();

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		this.doPost(request, response);
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		String action=request.getParameter("action");
		if(action==null||"getCategoryAll".equals(action)){
			getCategoryAll(request, response);
		}
	}


	private void getCategoryAll(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		request.setAttribute("categoryList", cs.findCategoryAll());
		request.getRequestDispatcher("jsp/profile_issue.jsp").forward(request, response);
		
	}

	


}
